package com.ftg.learn.chapter8.special;

import java.math.BigInteger;
import java.util.Arrays;

/**
 * 学习大整数
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/7/28 上午11:18
 */
public class LearnBigInteger {

    /**
     * @param x 字符串类型的整数 "123" "a1"
     * @param y
     * @return
     */
    public static int add(String x, String y) {
        return new BigInteger(x).add(new BigInteger(y)).intValue();
    }

    public static void main(String[] args) {
        System.out.println(add("4", "4"));
        int a = 9;

        //jvm自带的大整数
        System.out.println(2.0 - 1.1);

        BigInteger a1 = new BigInteger("-5");

        BigInteger a2 = new BigInteger("2");


        BigInteger a3 = new BigInteger("2");

        System.out.println(a3.toString() + "===>");

        System.out.println(a1.remainder(a2));

    }


}
